<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require('include/functions.php');
header("Content-type: text/html; charset=utf-8");
define('SCRIPT','ad_list');
if(!$_COOKIE['userid']){
    echo "<script type='text/javascript'>location.href='mlogin.php';</script>";
    exit;
}

       $sql3 = "select * from tbl_taospp  where id='".$_GET['fid']."'";
        $query3=mysql_query($sql3);
		$row3=mysql_fetch_array($query3);	
		$a =explode(",", $row3['img']);



?> 
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>商品评价-众晒网</title>
    <link href="/ui/css/Hui.css" rel="stylesheet" type="text/css"/>             
    <script src="/ui/js/jquery-1.9.1.min.js"></script>
    <script src="/ui/plugins/swiper/swiper.min.js"></script>
	<script type="text/javascript" src="/ui/layer/mobile/layer.js"></script> 
    <style type="text/css">
     tr{border-bottom:1px solid #EDEDED}
.layui-tab{-5px 0px 45px 0px;text-align:left!important}
::-webkit-scrollbar { display: none;}   /*隐藏右边滚动条*/
        #header{width:100%; position:absolute; top:0;}                /*顶部定位*/
        #main{width:100%; overflow: auto; position:absolute; top:45px;bottom:0px;}
    </style>  
    <style>
	#feedback{width:60px;margin:0 auto;}
	#feedback img{width:60px;height:60px;padding: 5px;box-shadow: 0 0 5px #ccc;border-radius: 5px;}
	.H-width-avg-4 {
    width: 100%;
	}
	select#sheng {
    border: 0px;
    margin-right: 196px;
    width: 55%;
	}
    select#shi {
    border: 0px;
    }
    select#qu {
    border: 0px;
    }
	.H-flex-item.H-padding-horizontal-both-10.H-font-size-16.H-padding-vertical-both-12 {
    height: 45px;
	}
	span {
    margin-top: -5px;
	}
	button.H-button.H-width-100-percent.H-font-size-18.H-outline-none.H-padding-vertical-both-8.H-padding-horizontal-both-17.H-theme-background-color8.H-theme-font-color-white.H-theme-border-color8.H-theme-border-color8-click.H-theme-background-color8-click.H-theme-font-color8-click.H-border-radius-3 {
    margin-top: 15px;
	}
	.H-margin-horizontal-both-10 {
    margin-left: 0px;
    width: 100%;
    margin-right: 10px;
	}
	.H-theme-background-color8 {
    background-color: #f26c27;
}
input#thegujia {
    margin-top: -6px;
}
select#shi {
    border: 0px;
    width: 122%;
}
select#sheng {
    border: 0px;
    margin-right: 196px;
    width: 55%;
}
.box{height: 45px;width: 300px;}
.box .comment{font-size: 30px;color: orange;}
.comment li{ float: left;cursor: pointer;}
ul{list-style: none;}
</style>      
</head>
<body ">
    <header class="H-header H-theme-background-color-white" id="header">
        <span tapmode="" onclick="window.location.href='main.php'" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-theme-font-color8 H-padding-horizontal-left-10 H-z-index-100"><label class="H-display-block H-vertical-middle H-font-size-15"><img src="/ui/image/发布取消叉@3x.png" style="width: 15px; height: 15px; margin-top: 15px; margin-left: 10px;"></label></span>
        <div class="H-header-title H-center-all H-font-size-18 H-text-show-row-1 H-theme-font-color-black H-position-absolute H-width-100-percent">商品评价</div>
    </header>
    <div id="main"> 
    <div class="H-flexbox-horizontal H-theme-background-color-white H-border-vertical-bottom-after" onclick="H.openWin('#', '#');">
                <div class="H-padding-vertical-both-10">
                    <img src="<?=$a[0]?>" srcs="" alt="" title="" class="imgCache H-display-block H-margin-horizontal-left-10" style="width: 70px; height:70px;">
                </div>
                <div class="H-flex-item H-padding-10 ">
                    <strong class="H-font-weight-normal font-weight-500 H-font-size-12 H-theme-font-color-black H-display-block H-text-show-row-1"><?=$row3[chtitle]?></strong>
                      
                    <div class="H-font-size-10 H-theme-font-color-999 H-text-show-row-2">
                      好评率：98%</div>                     
                    <div class="H-font-size-10 H-theme-font-color-999 H-text-show-row-2">                 
                       <div class="box">
					   
                            <ul class="comment" name="xingji">
                                <li value="1">☆</li>
                                <li value="2">☆</li>
                                <li value="3">☆</li>
                                <li value="4">☆</li>
                                <li value="5">☆</li>
                            </ul>
                        
                        </div> 
                    </div> 
                    <div class="H-font-size-10 H-theme-font-color-999 H-text-show-row-2">                 

                    </div>                    
                </div>
            </div>
    <div class="H-flexbox-horizontal">
        <textarea name="ziwop" id="ziwop" class="H-textbox H-vertical-align-middle H-vertical-middle H-font-size-12 H-flex-item H-box-sizing-border-box H-border-none H-outline-none H-padding-12" placeholder="请输入您的评论"></textarea>
    </div> 
       <div class="H-horizontal-center  H-overflow-hidden" style="min-height: 80px;">
            <div style="margin-left:10px;width:50px;height:83px" onclick="getElementById('inputfile').click()">
            <div style="float:left; height: 83px;">
            <img src="/ui/image/相机 -4.png"  style="margin-top:15px;width:50px;height:48px" alt="" title="添加照片">
            <input type="file" accept="image/*" multiple="multiple" id="inputfile" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: -100px;"/>
            <span style="font-size:12px">添加照片</span>
            </div>
            </div>
        </div>
		
    <div class="H-padding-vertical-bottom-10"></div>
    <div class="H-clear-both H-width-1-percent H-display-table H-box-sizing-border-box H-padding-horizontal-left-5">
        <div class="H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-4 H-padding-horizontal-right-5 H-margin-vertical-bottom-5">
           
            <div  style="width:100%"  id="feedback"  value="feedback" name="ywyuedu" >
			
            <input style=" display:none" id="srcall" name="ywyuedu">
        </div>

    </div>
    <div class="H-padding-vertical-bottom-10"></div>

 </div>
 
  <button type="button" onclick="clicimg()" class="am-btn am-btn-warning am-padding-sm" style="width: 88%; margin-left:6%;  margin-top: 75px; color: #ffffff; background: #ffa200;  bottom: 0px; font-weight: 800; border: 0;border-radius: 5px;height: 35px;">确认</button>
 
 
    <script src="/ui/script/H.js" type="text/javascript"></script>   
<!-- 多图上传 开始 -->
<script type="text/javascript">
$(document).ready(function(){
    //响应文件添加成功事件
    $("#inputfile").change(function(){
        //创建FormData对象
        var data = new FormData();
        //为FormData对象添加数据
        $.each($('#inputfile')[0].files, function(i, file) {
            data.append('upload_file'+i, file);
        });
         layer.open({
    type: 2
    ,content: '上传中...'
  }); //显示加载图片
        //发送数据
        $.ajax({
            url:'submit_form_process.php',
            type:'POST',
            data:data,
            cache: false,
            contentType: false,     //不可缺参数
            processData: false,     //不可缺参数
            success:function(data){
                data = $(data).html();
                //alert(data);
                //第一个feedback数据直接append，其他的用before第1个（ .eq(0).before() ）放至最前面。
                //data.replace(/&lt;/g,'<').replace(/&gt;/g,'>') 转换html标签，否则图片无法显示。
                if($("#feedback").children('img').length == 0) $("#feedback").append(data.replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
                else $("#feedback").children('img').eq(0).before(data.replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
				layer.closeAll();
                layer.open({
    content: '上传成功！'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });   //加载成功移除加载图片
            },
            error:function(){
                alert('上传出错');
                $(".loading").hide();   //加载失败移除加载图片
            }
        });
    });
});
</script>
<script type="text/javascript">
    function clicimg(){
        var legth=document.getElementsByName('thissrc');
        var srca="";
        for(var i=0;i<legth.length;i++){
            srca+=legth[i].src;
            srca+=",";
        }
        document.getElementById('srcall').value=srca;
        
	  var uid='<?=$_COOKIE['userid']?>';
	  var sku_id='0';
      var goods_id=<?=$_GET['fid']?>; 
	  
	  var order_id=<?=$_GET['id']?>;
	  
	var pic_arr= srca;
	
	var stars=98.00;
	
	var comment= document.getElementById("ziwop").value;
	
	var is_show_name=1;
	
	if(ziwop==""){
	layer.open({
    content: '请输入您的评论'
    ,skin: 'msg'
    ,time: 2 
    });
 	return false; 
	}					
                                $.ajax({
                                        url: '/api/muyin/api.php?s=haigou.add_good_comment',
                                        type: 'POST',
                                        dataType: 'json',
                                        data: {order_id: order_id,
										sku_id:sku_id,
										goods_id:goods_id,
										uid:uid,
										comment:comment,
										is_show_name:is_show_name,
										stars:stars,
										pic_arr:pic_arr												
										},
                                      })
									  
                                      .done(function(respon) {
                                        if (respon.code==0) {
                                       layer.open({
                                       content: '评价已完成'
                                      ,btn: ['知道了']
                                      ,yes: function(index){
                                 window.location.href=document.referrer;
                                     layer.close(index);
                                        }
                                        });
                                      
									  
                                        }else{
											
                                             layer.open({
    content: '请先输入完成后再提交！'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  }); 
                                        
                                        }
                                      })

    }
  
	
	

</script>
<!-- 分类选择结束 -->
  <script type="text/javascript">
        H.on(H.Ds(".H-accordion-title"), "touchend", function (event) {
            var area = H.getParents(event.target, "H-accordion-area");
            var title = H.D(".H-accordion-title", area);
            var main = H.D(".H-accordion-main", area);
            var icon = H.D(".H-accordion-icon", area);
            if (H.isElement(main)) {
                if (H.hasClass(main, "H-display-none-important")) {

                    H.removeClass(icon, "H-icon-arrow-down");
                    H.addClass(icon, "H-icon-arrow-up");

                    H.removeClass(title, "H-theme-background-color-white");
                    H.addClass(title, "H-theme-background-color-f4f4f4");

                    H.removeClass(main, "H-display-none-important");
                }
                else {
                    H.removeClass(icon, "H-icon-arrow-up");
                    H.addClass(icon, "H-icon-arrow-down");

                    H.removeClass(title, "H-theme-background-color-f4f4f4");
                    H.addClass(title, "H-theme-background-color-white");

                    H.addClass(main, "H-display-none-important");
                }
            }
        });
    </script>

</script>
<script>
    $(function(){
        var wjx_none = '☆'; // 空心五角星
        var wjx_sel = '★'; // 实心五角星

        //鼠标移进变实星
        $(".comment li").on("mouseover",function(){
            $(this).text(wjx_sel).prevAll("li").
            text(wjx_sel).end().nextAll().text(wjx_none);
            $("#aaa").val($(this).val());

        });

        //鼠标移出变空星
        $(".comment li").on("mouseout",function(){
           if($("li.current").length === 0){
                $(".comment li").text(wjx_none);
           }else{
               $("li .current").text(wjx_sel).prevAll().text(wjx_sel).end().nextAll().text(wjx_none);
           }
        });

        //鼠标点击保持当前状态
        $(".comment li").on("click",function(){
            $(this).attr("class","current").siblings().removeClass("current");

            $("#aaa").val($(this).val());
            // alert($(this).val());
        });


    });
</script>
</body>
</html>